package com.hanainfo.hanaApp;

import android.util.Log;

public class BallBean {
	String FirstBall;
	String SecondBall;
	String ThirdBall;
	String FourthBall;
	String FifthBall;
	String SixthBall;
	String Grwno;
	String GrwDate;
	int Id;
	
	public int getId() {
		return Id;
	}
	public void setId(String id) {
		Id = Integer.parseInt(id);
	}
	public String getFirstBall() {
		return FirstBall;
	}
	public void setFirstBall(String firstBall) {
		FirstBall = firstBall;
	}
	public String getSecondBall() {
		return SecondBall;
	}
	public void setSecondBall(String secondBall) {
		SecondBall = secondBall;
	}
	public String getThirdBall() {
		return ThirdBall;
	}
	public void setThirdBall(String thirdBall) {
		ThirdBall = thirdBall;
	}
	public String getFourthBall() {
		return FourthBall;
	}
	public void setFourthBall(String fourthBall) {
		FourthBall = fourthBall;
	}
	public String getFifthBall() {
		return FifthBall;
	}
	public void setFifthBall(String fifthBall) {
		FifthBall = fifthBall;
	}
	public String getSixthBall() {
		return SixthBall;
	}
	public void setSixthBall(String sixthBall) {
		SixthBall = sixthBall;
	}
	public String getGrwno() {
		return Grwno;
	}
	public void setGrwno(String grwno) {
		Grwno = grwno;
	}
	public String getGrwDate() {
		return GrwDate;
	}
	public void setGrwDate(String grwDate) {
		GrwDate = grwDate;
	}
	
	public String[] check(BallBean cMyBall, BallBean cLastBall){
		
		String[] myBall = new String[6];
		String[] lastBall = new String[6];
		Log.v("cMyBall.FirstBall;", cMyBall.FirstBall);
		myBall[0] = cMyBall.FirstBall;
		myBall[1] = cMyBall.SecondBall;
		myBall[2] = cMyBall.ThirdBall;
		myBall[3] = cMyBall.FourthBall;
		myBall[4] = cMyBall.FifthBall;
        myBall[5] = cMyBall.SixthBall;
        
        lastBall[0] = cLastBall.FirstBall;
		lastBall[1] = cLastBall.SecondBall;
		lastBall[2] = cLastBall.ThirdBall;
		lastBall[3] = cLastBall.FourthBall;
		lastBall[4] = cLastBall.FifthBall;
        lastBall[5] = cLastBall.SixthBall;
        int count = 0;
        String[] checkBall = new String[7];
        for(int i=0; i<6 ; i++){
        	for(int j=0; j<6 ; j++){
        		if(myBall[i].equals(lastBall[j])){
        			checkBall[count] = myBall[i];
        			count+=1;
        		}
        	}
        }
        checkBall[6] = Integer.toString(count);
        return checkBall;
    }
}
